Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a settings validator for coupling #1006

Merged

Conversation

albeanth
Copy link
Member

@albeanth albeanth commented Dec 2, 2022

Description

It's easy to set numCoupledIterations > 0 and forget to set looseCoupling: True. If you do this, then the coupling scheme will "run" but o.couplingIsActive() will evaluate to false. This can lead to unexpected results.

def couplingIsActive(self):
"""True if any kind of physics coupling is active."""
return self.cs["looseCoupling"] or self.cs["numCoupledIterations"] > 0

This settings validator aims to remedy this.


Checklist

  • This PR has only one purpose or idea.
  • Tests have been added/updated to verify that the new/changed code works.
  • The release notes (location doc/release/0.X.rst) are up-to-date with any bug fixes or new features.
  • The documentation is still up-to-date in the doc folder.
  • The dependencies are still up-to-date in setup.py.

- it's easy to set numCoupledIterations > 0 and forget to set looseCoupling: True.
- this settings validator checks that and corrects if found.
@albeanth albeanth marked this pull request as ready for review December 2, 2022 21:54
@john-science
Copy link
Member

This seems like a good use for a settings validator.

Great!

@john-science john-science merged commit dbc2b0c into terrapower:main Dec 14, 2022
@albeanth albeanth deleted the looseCoupling_SettingsValidator branch December 15, 2022 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants